Interpolates between two symbol patterns (only non-transpose symbols allowed). Suitable for calculating intermediate states between patterns, or creating smoothly transforming patterns. Both patterns must be of equal length. The output is in a list form ((x x x) (x x x) ...) where each sublist represents a pattern. Use flatten to make the result as a single list. Examine outputs in Listener and Visualizer. Notice also that both source and target patterns will appear in the output.
(symbol-interpolate
6
(reverse '(a b c d e f g h i j k l m n o p))
'(a b c d e f g h i j k l m n o p))
(flatten (symbol-interpolate
6
(reverse '(a b c d e f g h i j k l m n o p))
'(a b c d e f g h i j k l m n o p)))
Example on interpolating between 3 patterns
Define first 3 patterns.
(setq p1 '(a b c d e f g h))
(setq p2 '(a b c d d c b a))
(setq p3 '(h g f e d c b a))
Next count interpolations.
(setq p1-p2 (symbol-interpolate 8 p1 p2))
(setq p2-p3 (symbol-interpolate 8 p2 p3))
Then append interpolations. Note that p1-p2 already contains p2, so the first step must be removed from p2-p3.
(setq result (flatten (append p1-p2 (cdr p2-p3))))
The pattern lengths must equal, but their ranges can differ. Check out the following. Use symbol-trim to equalize pattern lengths if necessary. See also vector-interpolate.
(flatten (symbol-interpolate '(a b c d a b c d e f g h e f g h)